/*
 * @Author: zhangweixin 
 * @Date: 2018-11-12 10:24:12 
 * @Last Modified by: zhangweixin
 * @Last Modified time: 2018-11-12 10:32:34
 */

const path = require('path');
const webpack = require('webpack');

module.exports = {
  entry: path.join(__dirname, "src/index.js"),
  output: {
    path: path.join(__dirname,"dist"),
    filename:'bundle.js'
  },
  module:{
    rules:[
      {
        test:/\.js$/,
        use:[{
          loader:"babel-loader",
          options:{
            cacheDirectory: true,///*cacheDirectory是用来缓存编译结果，下次编译加速*/
          }
        }],
        include:path.join(__dirname,'src'),
      }
    ]
  },
  plugins:[
    new webpack.HotModuleReplacementPlugin()
  ]
}